<%= render 'base' %>

<div class="detail admin-edit-admin_doc">
  <div class="detail-action">
    <%= link_to icon_tag("arrow-left", label: "Back"), admin_docs_path, class: "btn" %>

    <%= link_to "Permanent delete!", admin_doc_path(@doc.id, permanent: true), class: "btn btn-danger", method: :delete, 'data-confirm' => "Are you sure delete this item? This will permanently delete Doc and it's versions in Database!" %>
  </div>


  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.title") %>:</div>
    <div class="detail-value"><%= @doc.title %></div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.url") %>:</div>
    <div class="detail-value"><%= link_to @doc.to_url, @doc.to_url, target: "_blank" %></div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.repository") %>:</div>
    <div class="detail-value"><%= user_name_tag(@doc.repository.user) %> / <%= repository_name_tag(@doc.repository) %></div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.editors") %>:</div>
    <div class="detail-value">
      <% @doc.editors.each do |user| %>
        <%= user_avatar_tag(user, style: :tiny) %>
      <% end %>
    </div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.comments_count") %>:</div>
    <div class="detail-value">
      <%= @doc.comments_count %> comments
    </div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.created_at") %>:</div>
    <div class="detail-value">
      <%= l @doc.created_at, format: :long %>
    </div>
  </div>

  <div class="detail-row">
    <div class="detail-label"><%= t("activerecord.attributes.doc.updated_at") %>:</div>
    <div class="detail-value">
      <%= l @doc.updated_at, format: :long %>
    </div>
  </div>

</div>